package com.ruoyi.lwpq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lwpq.mapper.LwpqKqMapper;
import com.ruoyi.lwpq.domain.LwpqKq;
import com.ruoyi.lwpq.service.ILwpqKqService;
import com.ruoyi.common.core.text.Convert;

/**
 * 考勤Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-15
 */
@Service
public class LwpqKqServiceImpl implements ILwpqKqService 
{
    @Autowired
    private LwpqKqMapper lwpqKqMapper;

    /**
     * 查询考勤
     * 
     * @param id 考勤主键
     * @return 考勤
     */
    @Override
    public LwpqKq selectLwpqKqById(Long id)
    {
        return lwpqKqMapper.selectLwpqKqById(id);
    }

    /**
     * 查询考勤列表
     * 
     * @param lwpqKq 考勤
     * @return 考勤
     */
    @Override
    public List<LwpqKq> selectLwpqKqList(LwpqKq lwpqKq)
    {
        return lwpqKqMapper.selectLwpqKqList(lwpqKq);
    }

    /**
     * 新增考勤
     * 
     * @param lwpqKq 考勤
     * @return 结果
     */
    @Override
    public int insertLwpqKq(LwpqKq lwpqKq)
    {
        lwpqKq.setCreateTime(DateUtils.getNowDate());
        return lwpqKqMapper.insertLwpqKq(lwpqKq);
    }

    /**
     * 修改考勤
     * 
     * @param lwpqKq 考勤
     * @return 结果
     */
    @Override
    public int updateLwpqKq(LwpqKq lwpqKq)
    {
        lwpqKq.setUpdateTime(DateUtils.getNowDate());
        return lwpqKqMapper.updateLwpqKq(lwpqKq);
    }

    /**
     * 批量删除考勤
     * 
     * @param ids 需要删除的考勤主键
     * @return 结果
     */
    @Override
    public int deleteLwpqKqByIds(String ids)
    {
        return lwpqKqMapper.deleteLwpqKqByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除考勤信息
     * 
     * @param id 考勤主键
     * @return 结果
     */
    @Override
    public int deleteLwpqKqById(Long id)
    {
        return lwpqKqMapper.deleteLwpqKqById(id);
    }
}
